#ifndef PROJEKT3_H
#define PROJEKT3_H

#include <QMainWindow>
#include <QVector>
#include <QLineEdit>
#include <QBoxLayout>
#include <QLabel>
#include <QProgressBar>

#include "qcustomplot.h"
#include "Worker.hpp"

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void startWortInAThread();
    void handleResult(Result result);
    void fin_CB();
    void fin_VBHh();
    void fin_VBLh();

    void compound_add();
    void compound_edit();
    void compound_edit(QListWidgetItem *item);

    void alloy_add();
    void alloy_edit();
    void alloy_edit(QListWidgetItem *item);

    void layer_add();
    void layer_edit();
    void layer_edit(QListWidgetItem * item);
    void layer_remove();

    void plot();

signals:
    void notifyCalculationProgress(int progress);

private:
    void initialize();
    Input createInputCB(double &);
    Input createInputVBHh(double &);
    Input createInputVBLh(double &);
    Result m_results;
    QVector<QVector<double> > m_graphData;
    QVector<double> m_vecX;
    bool m_finished_CB, m_finished_VBHh,m_finished_VBLh;


    QWidget * createCentralWidget();

    QWidget * createCompoundWidget();
    QWidget * createAlloysWidget();
    QWidget * createDesignWidget();

    QLineEdit* ilosc_podzialow_n_LE;
    QLineEdit* sigma_LE;
    QLabel* ilosc_podzialow_n_label;
    QLabel* sigma_label;
    QCustomPlot* custom_plot;
//    QCustomPlot* temp_plot;
    QPushButton* execute_button;
    QTabWidget* tabela;
    QListWidget* compound_LW;
    QListWidget* alloys_LW;
    QListWidget* layer_LW;
    QPushButton* compound_edit_button;
    QPushButton* compound_add_button;
    QPushButton* alloys_edit_button;
    QPushButton* alloys_add_button;
    QPushButton* layer_add_button;
    QPushButton* layer_edit_button;
    QPushButton* layer_remove_button;
    QTextEdit* log_TE;

    QProgressBar * calculationProgressBar;
};

#endif // PROJEKT3_H
